package com.plateform.shardingsphere.contoller;

import com.plateform.shardingsphere.domain.TpressureData;
import com.plateform.shardingsphere.service.TpressureDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;
import java.util.List;

/**
 * @ClassName TpressureDataContoller
 * @Description: TODO
 * @Author liupantao
 * @Date 2022/10/20
 * @Version V1.0
 **/
@Controller
public class TpressureDataContoller {

    @Autowired
    private TpressureDataService tpressureDataService;

    @RequestMapping(value = "/addDataTest")
    @ResponseBody
    public boolean addDataTest(){
        TpressureData data= new TpressureData ();
        data.setCreateTime (new Date ());
        data.setName ("test");
        boolean save = tpressureDataService.save (data);
        return  save;
    }

}
